Skip to content

Conversation

@pavanaravapalli
Copy link

PR fixes #12126.

Description

This PR...

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@pavanaravapalli pavanaravapalli marked this pull request as draft November 24, 2025 22:22
@pavanaravapalli pavanaravapalli changed the title Fix: clean up CloudStack metadata (zone, pod, cluster, host details) for vm (kvm) unmanage operation. WIP: clean up CloudStack metadata (zone, pod, cluster, host details) for vm (kvm) unmanage operation. Nov 24, 2025
@DaanHoogland DaanHoogland added this to the 4.23 milestone Nov 25, 2025
@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 53.84615% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.56%. Comparing base (8171d95) to head (6632809).
⚠️ Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
...a/com/cloud/agent/api/UnmanageInstanceCommand.java 50.00% 2 Missing ⚠️
...wrapper/LibvirtUnmanageInstanceCommandWrapper.java 0.00% 2 Missing ⚠️
.../java/com/cloud/agent/api/to/VirtualMachineTO.java 50.00% 1 Missing ⚠️
...ervisor/kvm/resource/LibvirtComputingResource.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main   #12127   +/-   ##
=========================================
  Coverage     17.56%   17.56%           
- Complexity    15538    15546    +8     
=========================================
  Files          5912     5913    +1     
  Lines        529383   529452   +69     
  Branches      64660    64671   +11     
=========================================
+ Hits          92984    93015   +31     
- Misses       425941   425979   +38     
  Partials      10458    10458           
Flag Coverage Δ
uitests 3.58% <ø> (+<0.01%) ⬆️
unittests 18.63% <53.84%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland
Copy link
Contributor

@pavanaravapalli , looks good. Please forgive me if I am mistaken, but didn’t we agree that leaving metadata in unmanaged VMs should be optional?
I see you unconditionally remove it on un-manage.

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 15830

@pavanaravapalli
Copy link
Author

pavanaravapalli commented Nov 25, 2025

@DaanHoogland

Thanks for checking. I wasn’t fully aligned with leaving the metadata as-is without a cleanup option, since it can lead to repetitive manual work and also raises data-security concerns when unmanaged VMs keep CS details.

As this PR is still in progress, I plan to add a toggle kvm.libvirt.xml.metadata.clean=true/false( global config ) to control metadata cleanup on unmanage.

… details) from Libvirt XML for KVM VMs after an unmanage operation, controlled by the global config vm.unmanage.libvirt.metadata.cleanup [default: true]
@pavanaravapalli
Copy link
Author

@blueorangutan package

@blueorangutan
Copy link

@pavanaravapalli a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@pavanaravapalli pavanaravapalli changed the title WIP: clean up CloudStack metadata (zone, pod, cluster, host details) for vm (kvm) unmanage operation. clean up CloudStack metadata (zone, pod, cluster, host details) for vm (kvm) unmanage operation. Nov 27, 2025
@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15840

@pavanaravapalli pavanaravapalli marked this pull request as ready for review November 27, 2025 12:22
Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-14876)

@pavanaravapalli
Copy link
Author

I believe the Jenkins build issues aren’t related to my code changes; they seem to be caused by the DB schema upgrade.

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 15844

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[KVM] CloudStack infrastructure metadata is preserved in libvirt XML after unmanaged VM operation (introduced in PR #11061)

3 participants